package ;

import easelhx.display.Stage;
import easelhx.display.Text;
import easelhx.utils.Ticker;
import easelhx.utils.UID;
import js.HTMLCanvasElement;
import js.Lib;
import tweenhx.Ease;
import tweenhx.Tween;

/**
 * ...
 * @author 
 */

class HelloWorldExample extends Example
{
	public function new() 
	{
		super();
	}
	
	override public function run():Void 
	{
		// Create a new Text object:
		var textTest = new Text("Hello World!!!", "36px Arial", "#777");
		// add the text as a child of the stage. This means it will be drawn any time the stage is updated
		// and that it's transformations will be relative to the stage coordinates:
		stage.addChild(textTest);
		
		//var circle:Shape = new Shape();
		//circle.graphics.beginFill("#FF0000").drawCircle(0, 0, 50);
		//stage.addChild(circle);
		//
		//Tween.get(circle, {loop:true}, true)
		//.to({x:500,y:200,alpha:0.1},1000,Ease.get(1))
		//.to( { x:0 }, 1000, Ease.get(-1))
		//.to( { x:0, y:0, alpha:1 }, 5000, Ease.bounceInOut);
		
		// position the text on screen, relative to the stage coordinates:
		textTest.x = 360;
		textTest.y = 200;
		
		Ticker.setFPS(20);
		// in order for the stage to continue to redraw when the Ticker is paused we need to add it with
		// the second ("pauseable") param set to false.
		Ticker.addListener(stage, false);
	}
	
	function tick() 
	{
		stage.update();
	}
	
}